package Helpers;

public class ViewHelpers 
{	
	public static String genererNumerosPages ( int page, int nbPages, String url )
	{
		StringBuilder sb = new StringBuilder ( );
			
		if ( nbPages > 1 )
		{
			sb.append("<p class=\"numerosPages\">Page " );
			
			for ( int i = 1; i <= nbPages; i ++ )
			{
				sb.append("<a href=\"" );
				sb.append( url );
				sb.append(i );
				sb.append( "\" " );
				if ( i == page )
					sb.append ( "class=\"pageCourante\"" );
				sb.append ( ">");
				sb.append(i );
				sb.append("</a>&nbsp;&nbsp;&nbsp;");
			}
			
			sb.append ("</p>");
		}
		
		return sb.toString();
	}
}
